{template:header}
{template:usercp_menu}
<div id="ucp_content">
	<h3>{$lang['usercp']}</h3>
	<em>{$lang['avatarlist']}: {$currentcategories}</em>
	<form action='usercp.php' method='post'>
		<input type='hidden' name='s' value='{sessionid}' />
		<input type='hidden' name='do' value='getgallery' />
		<div class='ucp'>
			{$lang['otheravatarlist']}
			<select name='av_cat' class="select_normal">
				<foreach="$categories AS $cat">
				<option value='{$cat[0]}'>{$cat[1]}</option>
				</foreach>
			</select>
			<input type="submit" accesskey="s" value=" {$lang['_ok']} " name="submit" class="button_normal" />
		</div>
	</form>
	<form action='usercp.php' method='post'>
		<input type='hidden' name='s' value='{sessionid}' />
		<input type='hidden' name='posthash' value='{$posthash}' />
		<input type='hidden' name='do' value='setinternalavatar' />
		<input type='hidden' name='current_folder' value='{$current_folder}' />
		<div class='ucp'>
			<table width='100%' cellpadding='0' cellspacing='1' class='ttable'>
			<tbody class="tbody">
			<if="$avatar_list_show == 1">
			<foreach="$galleryimages AS $img">
				<php>
				$c++;
				</php>
				<if="$c == 1">
				<tr>
				</if>
					<td align='center'><img src='images/avatars{$currentavatar}/{$img['file']}' border='0' alt='' /><br /><input type='radio' class='radiobutton' name='avatar' value='{$img['encode']}' id='{$img['encode']}' />&nbsp;<strong><label for='{$img['encode']}'>{$img['name']}</label></strong></td>
				<if="$c == $colspan">
				</tr>
				<php>
				$c = 0;
				</php>
				</if>
			</foreach>
			</if>
			<if="$c != $colspan">
				<php>
				for ($i = $c ; $i < $colspan ; ++$i) {
				</php>
					<td>&nbsp;</td>
				<php>
				}
				</php>
				</tr>
			</if>
			</tbody>
			</table>
		</div>
		<div class="ucp item_change">
			<input type="submit" name="submit" value="{$lang['useselectedavatar']}" class="input_big" />
			<input type="button" name="remove" onclick="self.location='usercp.php{sessionurl}do=editavatar';" value="{$lang['gobackavatar']}" class="input_big" />
		</div>
	</form>
</div>
{template:footer}